package march.test_3_30;

import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String t = scanner.nextLine();
        int tmp = 0;
        for (int i = s.length() - 1; i >= 0; i--) {
            if(s.charAt(i) != t.charAt(i)) {
                tmp = i;
                break;
            }
        }
        int a = tmp + 1;
        int b = tmp + 1;
        for(int i = 0; i < tmp - 1; i++) {
            if(s.charAt(i) == s.charAt(i + 1)) {
                a--;
            }
            if(t.charAt(i) == t.charAt(i + 1)) {
                b--;
            }
        }


        if(a < b) {
            System.out.println(a);
            for(int i = tmp; i >= 0; i--) {
                int count = i;
                while (i > 0 && s.charAt(i) == s.charAt(i - 1)) {
                    i--;
                }
                System.out.print(2 + " " + (count+1)+" ");
                System.out.println(s.charAt(i));
            }
        } else {
            System.out.println(b);
            for(int i = tmp; i >= 0; i--) {
                int count = i;
                while (i > 0 && t.charAt(i) == t.charAt(i - 1)) {
                    i--;
                }
                System.out.print(2 + " " + (count+1)+" ");
                System.out.println(t.charAt(i));
            }
        }
    }
}
